﻿// Copyright (c)  YISH. All rights reserved.
// Licensed under the MIT License, See License.txt in the project root for license information.

using NSQL.Expressions;
using NSQL.Sharpen;

namespace NSQL.Statements
{
    public class SortingElement : ISortingElement
    {
        public SortingDirection Direction { get; set; }
        public IExpression Element { get; set; }

        public SortingElement()
        {
        }

        public SortingElement(ColumnExpression element, SortingDirection direction = SortingDirection.None)
        {
            Element = element;
            Direction = direction;
        }
        
        public SortingElement(IExpression element, SortingDirection direction = SortingDirection.None)
        {
            Element = element;
            Direction = direction;
        }

        public object Tag { get; set; }
        public object Clone()
        {
            throw new System.NotImplementedException();
        }

        object IDeepClone.DeepCopy()
        {
            return new SortingElement()
            {
                Direction = Direction,
                Element = Element
            };
        }
    }
}